<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="num1">
    <input type="text" id="num2">
    <button onclick="fn()">=</button>
    <input type="text" id="num3">
    <input type="button" value="opener" onclick="fn2()">
    <script>
        function fn(){
            var input1=document.getElementById('num1');
            var num1=Number(input1.value);
            console.log(num1);
            var input2=document.getElementById('num2');
            var num2=Number(input2.value);
            var input3=document.getElementById('num3');
            var num3=num1+num2;
            input3.value=num3;
            function fn2(){
                alert(opener);
            }

        }
    </script>
</body>
</html>